package com.imooc.miaosha.controller.BackController;

import com.github.pagehelper.PageHelper;
import com.imooc.miaosha.pojo.SustinLog;
import com.imooc.miaosha.service.SustinLogService;
import com.imooc.miaosha.util.JsonData;
import com.imooc.miaosha.vo.SustinLogVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SustinLogController {
    @Autowired
    SustinLogService sustinLogService;

    @RequestMapping("/listSustinLog")
    public JsonData getSustinLogList(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<SustinLog> sustinLogList = sustinLogService.sustinLogList();
        return JsonData.pageableSuccess(sustinLogService.count(), sustinLogList);
    }
}
